<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.d1{
				width: 300px;
				height: 300px;
				background: red;
			}
			
			.d2{
				width: 300px;
				height: 300px;
				background: yellow;
			}
		</style>
	</head>
	<body>
		<div class="d1">
			
		</div>
		
		<script src="../jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			
			$("div").click(function(){
				var d=this.className=="d1"?"d2":"d1";
				console.log(d);
//				$(this).toggleClass(d);
//				this.className=d;
				$(this).addClass(d);
			})
		</script>
	</body>
</html>
